package com.ruoyi.framework.config;

import com.ruoyi.framework.interceptor.AppUserLoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class AppLoginConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration registration = registry.addInterceptor(new AppUserLoginInterceptor());

        List<String> pathPatterns = new ArrayList<>();

        registration.addPathPatterns(
                "/app/login"
        ); //所有路径都被拦截
        registration.excludePathPatterns(
                //添加不拦截路径
        );
    }
}
